package com.spdzen.model;


import com.baomidou.mybatisplus.activerecord.Model;
import java.util.Date;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;

import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotBlank;

import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableName;
import com.spdzen.support.validation.UpdateValidGroup;
import com.baomidou.mybatisplus.annotations.TableId;
import java.io.Serializable;


/**
 * <p>
 * 新闻分类
 * </p>
 *
 * @author accountwcx@qq.com
 * @since 2017-03-16
 */
@TableName("spd_news_category")
public class NewsCategory extends Model<NewsCategory> {

    private static final long serialVersionUID = 1L;


    @NotNull(groups = {UpdateValidGroup.class})
    @Min(value = 1L, groups = {UpdateValidGroup.class})
	@TableId("id")
	private Long id;
    /**
     * 上级分类id
     */

	@TableField("parent_id")
	private Long parentId;
    /**
     * 分类编号
     */

	@NotBlank
	@Length(min = 1, max = 30)
	@TableField("code")
	private String code;
    /**
     * 分类名称
     */

	@TableField("name")
	@NotBlank
	@Length(min = 1, max = 30)
	private String name;
	
	@TableField("sort")
	private Integer sort;
	
    /**
     * 操作时间（创建/修改）
     */

	@TableField("operate_time")
	private Date operateTime;
    /**
     * 操作人id
     */

	@TableField("operate_id")
	private Long operateId;


	public Long getId() {
		return id;
	}

	public NewsCategory setId(Long id) {
		this.id = id;
		return this;
	}

	public Long getParentId() {
		return parentId;
	}

	public NewsCategory setParentId(Long parentId) {
		this.parentId = parentId;
		return this;
	}

	public String getCode() {
		return code;
	}

	public NewsCategory setCode(String code) {
		this.code = code;
		return this;
	}

	public String getName() {
		return name;
	}

	public NewsCategory setName(String name) {
		this.name = name;
		return this;
	}

	public Integer getSort() {
		return sort;
	}

	public void setSort(Integer sort) {
		this.sort = sort;
	}

	public Date getOperateTime() {
		return operateTime;
	}

	public NewsCategory setOperateTime(Date operateTime) {
		this.operateTime = operateTime;
		return this;
	}

	public Long getOperateId() {
		return operateId;
	}

	public NewsCategory setOperateId(Long operateId) {
		this.operateId = operateId;
		return this;
	}

	@Override
	protected Serializable pkVal() {
		return this.id;
	}

}